//
//  SQButton.m
//  社区外勤
//
//  Created by HanenDev on 15/11/10.
//  Copyright © 2015年 Hanen. All rights reserved.
//

#import "SQButton.h"

@implementation SQButton
- (id)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        
        //        self.imageView.backgroundColor = BlueColor;
        
        //        self.layer.borderColor = [UIColor lightGrayColor].CGColor;
        //        self.layer.borderWidth = 1.0f;
        //        UIView *view = [[UIView alloc] initWithFrame:CGRectMake(self.titleLabel.maxX , 0, 1, self.height)];
        //        view.backgroundColor = [UIColor lightGrayColor];
        //        [self addSubview:view];
        //        self.imageView.layer.borderColor = [UIColor colorWithWhite:0.8 alpha:0.8].CGColor;
        //        self.imageView.layer.borderWidth = 1;
    }
    return self;
}
#pragma mark - 设置按钮内部图片和文字的frame
- (CGRect)imageRectForContentRect:(CGRect)contentRect
{
    CGFloat W = 25 ;
    //    CGFloat H = contentRect.size.height;
    return CGRectMake(contentRect.size.width * 0.45 - W , contentRect.size.height / 2.0f - W / 2.0f, W, W);
    
}
//
- (CGRect)titleRectForContentRect:(CGRect)contentRect
{
    CGFloat W1 = contentRect.size.width;
    CGFloat H = contentRect.size.height;
    return CGRectMake( W1 * 0.45, 0, W1 *0.65, H);
    
}
@end
